#@datagrid()
#define content_header()
<h1>
    <a href="/agency">代理会员管理</a>
    <small>agency tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">代理</a></li>
    <li class="active">代理会员管理</li>
</ol>
#end
#define content()
<div class="box">
    <div class="box-header">
        <ul class="nav nav-tabs">
            <li><a href="/agency">全部</a></li>
            <li><a href="/agency/todaylist">今日新增</a></li>
            <li><a href="/agency/weeklist">本周新增</a></li>
            <li class="active"><a href="/agency/unlogin30">30天未登录</a></li>
        </ul>
        <form class="form-inline" action="/agency/unlogin30/1">
           <div class="form-group">
                <label>注册时间</label>
                <input type="text" name="date1" class="form-control input-sm xsui-jedatepicker" placeholder="起始时间..." title="" value="#(date1??)">
                 - 
                <input type="text" name="date2" class="form-control input-sm xsui-jedatepicker" placeholder="终止时间..." title="" value="#(date2??)" style="margin-right:10px">
            </div>
            <div class="form-group">
                <label>代理ID/昵称</label>
                <input type="text" name="word" class="form-control input-sm" placeholder="会员ID/昵称.." title="会员ID" value="#(word??)">
            </div>
            <button type="submit" class="btn btn-sm btn-primary">搜索</button>
        </form>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div class="xsui-datagrid-info">共<span class="text-danger">#(listPage.getTotalRow())</span>条</div>
        <table class="table table-condensed table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th>代理ID</th>
                    <th>上级ID</th>
                    <th>会员名</th>
                    <th>账户余额</th>
                    <th>今日收入总额</th>
                    <th>累计收入金额</th>
                    <th>今日提现金额</th>
                    <th>累计提现金额</th>
                    <th>今日充值金额</th>
                    <th>累计充值金额</th>
                    <th>今日消费金额</th>
                    <th>累计消费金额</th>
                    <th>下级代理数量</th>
                    <th>顶级代理</th>
                    <th>时间</th>
                </tr>
            </thead>
            <tbody>
                #for(x : listPage.getList())
                <tr data-key="#(x.user_id)">
                    <td><a href="/agency/childagent1?user_id=#(x.user_id)">#(x.user_id)</a></td>
                    <td>#(x.parent1_uid)</td>
                    <td>#(x.nickname)</td>
                    <td>#(x.blance)</td>
                    <td><!-- 今日收入总额 -->
                    	#if(x.income_amount_today != 0.0)
                    		<a href="/agency/transaction_detail?user_id=#(x.user_id)&&cash_type=1&&cash_date=1">#(x.income_amount_today)</a>
                    	#else
                    		#(x.income_amount_today)
                    	#end
                    </td>
                    <td><!-- 累计收入金额 -->
                    	#if(x.income_amount_total != 0.0)
                    		<a href="/agency/transaction_detail?user_id=#(x.user_id)&&cash_type=1&&cash_date=2">#(x.income_amount_total)</a>
                    	#else
                    		#(x.income_amount_total)
                    	#end
                    </td>
                    <td><!-- 今日提现金额 -->
                    	#if(x.withdraw_amount_today != 0.0)
                    		<a href="/agency/transaction_detail?user_id=#(x.user_id)&&cash_type=2&&cash_date=1">#(x.withdraw_amount_today)</a>
                    	#else
                    		#(x.withdraw_amount_today)
                    	#end
                    		
                    </td>
                    <td><!-- 累计提现金额 -->
                    	#if(x.withdraw_amount_total != 0.0)
                    		<a href="/agency/transaction_detail?user_id=#(x.user_id)&&cash_type=2&&cash_date=2">#(x.withdraw_amount_total)</a>
                    	#else
                    		#(x.withdraw_amount_total)
                    	#end
                    </td>
                    <td><!-- 今日充值金额 -->
                    	#if(x.recharge_amount_today != 0.0)
                    		<a href="/agency/transaction_detail?user_id=#(x.user_id)&&cash_type=3&&cash_date=1">#(x.recharge_amount_today)</a>
                    	#else
                    		#(x.recharge_amount_today)
                    	#end
                    </td>
                    <td><!-- 累计充值金额 -->
                    	#if(x.recharge_amount_total != 0.0)
                    		<a href="/agency/transaction_detail?user_id=#(x.user_id)&&cash_type=3&&cash_date=2">#(x.recharge_amount_total)</a>
                    	#else
                    		#(x.recharge_amount_total)
                    	#end
                    </td>
                    <td>JRXFJE</td>
                    <td>LJXFJE</td>
                    <td>
						#(x.child1_agent_count>0?"<a href='/agency/childagent1?user_id="+x.user_id+"'>"+x.child1_agent_count+"</a>":0)
                    </td>
                    <td>#(x.top_agent_id)</td> 
                    <td>#(x.regist_date)</td>               
                </tr>
                #end
            </tbody>
        </table>
        #@paginate(listPage.pageNumber, listPage.totalPage, "/agency/unlogin30/")
    </div>
    <!-- /.box-body -->
</div>
<!-- /.box -->
#end